#!/usr/bin/env zsh

if [[ $1 == "--" ]]; then
    font=""
else
    font=$1
fi

WIDTH=$2
UNICODE_START=$3

echo "════ [${font}] ═════════════════════════════════════"
bin/make_json "ClockFace${font}-glyphs" ${WIDTH} ${UNICODE_START} "ClockFace${font}" > "ClockFace${font}-temp.json"

# Fix trailing array comma with prettier
npm exec prettier "ClockFace${font}-temp.json" > "ClockFace${font}.json"
rm "ClockFace${font}-temp.json"

bin/svgs2ttf "ClockFace${font}.json"
